package com.mujin.keji.collectionsystem.module.updata.views;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.mujin.keji.collectionsystem.CcsApplication;
import com.mujin.keji.collectionsystem.R;
import com.mujin.keji.collectionsystem.base.BaseActivity;
import com.mujin.keji.collectionsystem.module.updata.dto.VisitUserDto;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;



/**
 * 浏览照片
 *
 * @author weishixiong
 * @Time 2018-06-28
 */

public class ViewPhotosActivity extends BaseActivity {
    private ImageView photoView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EventBus.getDefault().register(this);
        CcsApplication.addActivity(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
        CcsApplication.removeActivity(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
    public void getFile(VisitUserDto visitUserDto) {
        Glide.with(this).load(visitUserDto.getFile()).into(photoView);
    }

    @Override
    protected void createViewModel() {

    }

    @Override
    public int intiLayout() {
        return R.layout.activity_viewphotos;
    }

    @Override
    public void initView() {
        photoView = (ImageView) findViewById(R.id.photoView);
    }

    @Override
    public void initData() {
    }
    @Override
    public void initListener() {

    }
}
